using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Response.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.Tools;

namespace MinimalistFoodStreet.BackEnd.Server.Server.ResponseExtend.Tables 
{
	public static class ActionLogsEnitityExtend 
	{
		public static ResponseActionLogsDto ToResponseDto(this ActionLog entity)
		{
			return new ResponseActionLogsDto ()
			{

					id = entity.AlId,
					message = entity.AlMessage,
					requestParams = entity.AlRequestParams,
					requestUrl = entity.AlRequestUrl,
					requestMethod = entity.AlRequestMethod,
					ip = entity.AlIp,
					affectedRows = entity.AlAffectedRows,
					accountId = entity.AlAccountId,
					createTime = entity.AlCreateTime,
					createTimeStr = Tools.TimeToString(entity.AlCreateTime),
			};
		}
	}
}